package me.ereach.lambdas;

public class Main01 {
    public static String surfix = " surfix";

    public static void main(String[] args) {
        String prefix = "prefix ";

        greet(new ConsolePrinter());

        greet(new Printer() {
            @Override
            public void print(String message) {
                System.out.println("===" + message + "===");
            }
        });

        greet((String message) -> {
            System.out.println("+++" + message + "+++");
        });

        greet(message -> System.out.println("@@@" + message + "@@@"));

        greet(message -> System.out.println(message));

        greet(System.out::println);

        greet(message -> System.out.printf(prefix + message + surfix));
    }

    public static void greet(Printer printer) {
        printer.print("Hello, World");
    }
}
